<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>大小写转换</title>
</head>
<body>
<textarea title="" id="z"></textarea>
<button id="bag">转大写</button>
<button id="lit">转小写</button>
<textarea title="" id="x"></textarea>
</body>
<script>
    var z = document.querySelector("#z");
    var x = document.querySelector("#x");
    var bag = document.querySelector("#bag");
    var lit = document.querySelector("#lit");
    bag.addEventListener("click",function(){
        x.value = z.value.toLocaleUpperCase();
    });
    lit.addEventListener("click",function(){
        x.value = x.value.toLocaleLowerCase();
    });
</script>
</html>